Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deverification copy changes #4790

Merged
merged 5 commits into from
Oct 1, 2024

Conversation

divine-comedian
Copy link
Contributor

@divine-comedian divine-comedian commented Sep 26, 2024

deverification copy changes and remove givpower rank modal for vouched projects

Summary by CodeRabbit

  • New Features

    • Updated labels and descriptions for the DeVouch feature across multiple languages to enhance clarity and user guidance.
    • Introduced new messaging for GIVbacks eligibility, including dynamic links for staking information.
    • Added tooltips and clearer descriptions in the donation section to improve user experience.
  • Bug Fixes

    • Corrected navigation and action descriptions to better reflect user actions related to DeVouch and GIVbacks.
  • Documentation

    • Enhanced clarity in user interface messages regarding project verification and GIVbacks processes.

Copy link

vercel bot commented Sep 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
giveth-dapps-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 30, 2024 10:46pm

Copy link
Contributor

coderabbitai bot commented Sep 26, 2024

Walkthrough

The changes involve updates to language files (lang/ca.json, lang/en.json, lang/es.json, lang/t_ca.json) and modifications to several components related to the DeVouch feature and GIVbacks. These updates include renaming labels, rephrasing descriptions for clarity, and adjusting the rendering logic in components to enhance user guidance regarding project verification and GIVbacks eligibility.

Changes

File Change Summary
lang/ca.json, lang/en.json, lang/es.json, lang/t_ca.json Updated labels and descriptions related to DeVouch and GIVbacks, improving clarity and guidance.
src/components/views/project/projectGIVPower/index.tsx Added new state variables and conditional rendering logic based on project verification and GIVbacks eligibility.

Possibly related PRs

Suggested reviewers

  • mohammadranjbarz
  • RamRamez

🐰 In the fields where the bunnies play,
Labels and texts have found their way.
With DeVouch and GIVbacks shining bright,
Clarity blooms in the soft moonlight.
Hop along, dear friends, let's cheer,
For changes that bring us all near! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 90a6c55 and 3ce892c.

📒 Files selected for processing (3)
  • lang/ca.json (1 hunks)
  • lang/en.json (2 hunks)
  • lang/es.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • lang/ca.json
  • lang/en.json
  • lang/es.json

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (4)
src/components/views/project/projectGIVPower/index.tsx (2)

31-33: LGTM: New variables for project status

The introduction of isVerified, isGivbackEligible, and isVerifiedNotGivbacksEligible variables is appropriate and aligns with the PR objectives. These variables provide clear, semantic checks for the project's status.

Consider using the nullish coalescing operator for a more concise expression:

-const isVerified = projectData?.verified;
-const isGivbackEligible = projectData?.isGivbackEligible;
+const isVerified = projectData?.verified ?? false;
+const isGivbackEligible = projectData?.isGivbackEligible ?? false;

This ensures that these variables are always boolean, even if projectData is undefined.


62-66: LGTM: Conditional rendering of GIVpowerCard

The conditional rendering of the GIVpowerCard component based on isVerifiedNotGivbacksEligible correctly implements the PR objective of removing the GivPower rank modal for verified projects that are not eligible for Givbacks.

To improve readability, consider extracting the condition into a descriptive variable:

+const shouldShowGIVpowerCard = !isVerifiedNotGivbacksEligible;

-{!isVerifiedNotGivbacksEligible && (
+{shouldShowGIVpowerCard && (
  <Col lg={4}>
    <GIVpowerCard />
  </Col>
)}

This makes the intent of the condition more explicit and easier to understand at a glance.

src/components/views/project/ProjectGIVbackToast.tsx (1)

248-259: LGTM! Consider extracting the link component for better readability.

The changes look good and align with the previous modification. The dynamic inclusion of the stakeLock link in the description improves the contextual relevance for verified owners who are not eligible.

To improve code readability, consider extracting the InnerLink component into a separate variable:

 description = formatMessage(
   {
     id: `${useIntlDescription}verified_owner_not_eligible`,
   },
   {
     stakeLock: (
-      <InnerLink href={Routes.GIVfarm} target='_blank'>
-        {formatMessage({ id: 'label.stake_and_lock' })}{' '}
-      </InnerLink>
+      <StakeLockLink />
     ),
   },
 );

+const StakeLockLink = () => (
+  <InnerLink href={Routes.GIVfarm} target='_blank'>
+    {formatMessage({ id: 'label.stake_and_lock' })}{' '}
+  </InnerLink>
+);

This extraction would make the formatMessage call cleaner and more focused on its primary purpose.

lang/en.json (1)

313-313: Informative description for vouching feature

The new description for the vouching feature is clear and informative. It effectively explains the purpose of DeVouch and the potential benefits of vouching for a project.

Consider adding a brief mention of what "DeVouch" is for users who might be unfamiliar with the term. For example:

- "With DeVouch, you can signal your support for this project by attesting to its legitimacy, potentially increasing the benefits it receives on Giveth."
+ "With DeVouch, our decentralized verification system, you can signal your support for this project by attesting to its legitimacy, potentially increasing the benefits it receives on Giveth."
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 2feb18e and f96d0e8.

📒 Files selected for processing (6)
  • lang/ca.json (2 hunks)
  • lang/en.json (2 hunks)
  • lang/es.json (2 hunks)
  • src/components/views/project/ProjectDevouchBox.tsx (2 hunks)
  • src/components/views/project/ProjectGIVbackToast.tsx (2 hunks)
  • src/components/views/project/projectGIVPower/index.tsx (2 hunks)
🔇 Additional comments (18)
src/components/views/project/projectGIVPower/index.tsx (2)

28-29: LGTM: Destructuring projectData from useProjectContext

The addition of projectData to the destructured values from useProjectContext is appropriate and aligns with the intended changes described in the PR objectives.


Line range hint 1-76: Summary: PR objectives successfully implemented

The changes in this file successfully implement the PR objectives related to the deverification copy changes and the removal of the GivPower rank modal for verified projects that are not eligible for Givbacks. The code is well-structured and follows React best practices.

Key points:

  1. New variables have been introduced to determine project verification and Givback eligibility status.
  2. The GIVpowerCard component is now conditionally rendered based on these new variables.
  3. The changes align with the PR objectives and improve the clarity of the deverification process.

Minor suggestions for improvement have been made to enhance code readability and robustness. Overall, the implementation is sound and achieves the intended goals.

src/components/views/project/ProjectDevouchBox.tsx (4)

41-41: LGTM: Message identifier update aligns with PR objectives.

The change from 'label.devouch.view_this_project' to 'label.devouch.title.vouch_this_project' is consistent with the PR's focus on updating the deverification copy. This modification shifts the emphasis from "viewing" to "vouching" for a project, which appears to be the intended direction.


46-46: LGTM: Description identifier update is consistent with title change.

The modification from 'label.devouch.if_you_are_eligible' to 'label.devouch.description.vouch_this_project' aligns well with the previous title change. This update maintains consistency in the messaging, focusing on the act of vouching for a project rather than discussing eligibility.


Line range hint 1-165: Summary: Copy changes align with PR objectives, functionality verification recommended.

The changes in this file consistently update the copy related to the deverification process, aligning well with the PR objectives. The modifications shift the focus from "viewing" to "vouching" for a project and update the button label to reflect a possible change in user flow.

While the copy changes look good, it's important to verify that the button functionality aligns with the new label, especially regarding navigation to the devouch page versus direct attestation.


65-65: LGTM: Button label update approved, but verify functionality.

The change from 'label.devouch.attest_on_devouch' to 'label.devouch.go_to_devouch' is consistent with the overall copy updates. However, this modification suggests a potential change in the user action or flow.

Please confirm that this label change aligns with the current functionality of the button. Does it now navigate to a devouch page instead of directly attesting? Run the following script to check for any related changes in the button's behavior:

src/components/views/project/ProjectGIVbackToast.tsx (1)

230-230: LGTM! Verify the new route for "stake and lock".

The change from Routes.GIVeconomy to Routes.GIVfarm for the "stake and lock" link looks good. It appears to be a more specific and relevant route for this action.

To ensure the correctness of this change, please run the following script to verify the existence and usage of the Routes.GIVfarm constant:

✅ Verification successful

Routes.GIVfarm is correctly defined and properly used.

The Routes.GIVfarm constant is defined in src/lib/constants/Routes.ts and is appropriately utilized across the codebase for the "stake and lock" functionality.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence and usage of Routes.GIVfarm

# Test 1: Check if Routes.GIVfarm is defined
echo "Checking if Routes.GIVfarm is defined:"
rg --type typescript "GIVfarm.*=.*" src/lib/constants/Routes.ts

# Test 2: Check for other usages of Routes.GIVfarm in the codebase
echo "Checking for other usages of Routes.GIVfarm:"
rg --type typescript "Routes\.GIVfarm" -g '!src/components/views/project/ProjectGIVbackToast.tsx'

Length of output: 421


Script:

#!/bin/bash
# Description: Verify the existence and usage of Routes.GIVfarm

# Test 1: Check if Routes.GIVfarm is defined
echo "Checking if Routes.GIVfarm is defined:"
rg --type ts "GIVfarm\s*=" src/lib/constants/Routes.ts

# Test 2: Check for other usages of Routes.GIVfarm in the codebase
echo "Checking for other usages of Routes.GIVfarm:"
rg --type ts "Routes\.GIVfarm" --type-add 'tsx:*.tsx' -g '!src/components/views/project/ProjectGIVbackToast.tsx'

Length of output: 1819


Script:

#!/bin/bash
# Description: Search for the definition of Routes.GIVfarm across the entire codebase

echo "Searching for the definition of Routes.GIVfarm in the entire codebase:"
rg "Routes\.GIVfarm\s*="

Length of output: 177


Script:

#!/bin/bash
# Description: Broad search for any definition or usage patterns of GIVfarm

echo "Searching for any definitions or assignments of GIVfarm:"
rg "GIVfarm\s*[:=]" 

echo "Searching for any dynamic or indirect definitions of GIVfarm:"
rg "define.*GIVfarm" 

Length of output: 439

lang/en.json (2)

311-311: Improved clarity in UI text

The change from "Attest on Devouch" to "Go to DeVouch" is a good improvement. It makes the action clearer and more direct for users.


312-312: Clear new label for vouching

The addition of "Vouch for this Project" is a good, clear label for the vouching feature. It effectively communicates the action available to users.

lang/es.json (4)

311-312: Approved: Label updated to reflect navigation action

The label for "devouch.go_to_devouch" has been updated from "Certificar en DeVouch" to "Ir a DeVouch". This change shifts the meaning from a certification action to a navigation action, which may better reflect the intended user flow.


312-313: Approved: Improved clarity in DeVouch description

The description for "devouch.description.vouch_this_project" has been updated to provide a clearer explanation of the DeVouch feature. The new text emphasizes the act of supporting the project by vouching for its legitimacy and explains the potential benefits. This change should help users better understand the purpose and impact of using DeVouch.


314-314: Approved: More direct and action-oriented title

The title for "devouch.title.vouch_this_project" has been updated to "Avalar este Proyecto". This change simplifies the title and makes it more action-oriented, clearly stating the action the user can take. This improvement should make the purpose of the feature more immediately clear to users.


1649-1651: Approved: Enhanced project information and personalization

The descriptions for verified project owners have been significantly improved:

  1. For "verified_owner_not_eligible", the text now provides more specific information about project endorsement, GIVpower benefits, and the ability to boost the project's position. It also clarifies that the project can be boosted but doesn't generate GIVbacks.

  2. For "verified_public_not_eligible", a placeholder for dynamic content has been added ({stakeLock}), likely to provide personalized instructions. The text also clarifies the benefits of GIVpower and the project's status regarding GIVbacks.

These changes offer more detailed and personalized information to project owners, which should help them better understand their project's status and available actions.

lang/ca.json (5)

311-312: Change in label for navigating to DeVouch confirmed

The label for navigating to DeVouch has been updated as mentioned in the AI-generated summary.

Old: "label.devouch.attest_on_devouch": "Certifica a DeVouch"
New: "label.devouch.go_to_devouch": "Anar a DeVouch"

This change makes the action clearer and more direct.


312-313: Description for vouching updated as expected

The description for vouching for a project has been rephrased as indicated in the AI-generated summary. The new text clarifies the process and its potential benefits.

Old: "label.devouch.if_you_are_eligible": "Si ets un verificador elegible de Giveth, pots avalar la legitimitat d'aquest projecte, potencialment augmentant els beneficis que rep a Giveth."
New: "label.devouch.description.vouch_this_project": "Amb DeVouch, pots assenyalar el teu suport a aquest projecte testificant la seva legitimitat, cosa que potencialment augmentarà els beneficis que rep a Giveth."

This change provides a clearer explanation of the DeVouch process.


314-314: Title for vouching updated correctly

The title for vouching for a project has been updated as mentioned in the AI-generated summary.

Old: "label.devouch.view_this_project": "Veure aquest projecte a DeVouch"
New: "label.devouch.title.vouch_this_project": "Avalar aquest Projecte"

This change makes the action more clear and direct.


1649-1651: GIVbacks descriptions updated with placeholder for staking information

The descriptions for verified owners and public projects not eligible for GIVbacks have been modified to include a placeholder for staking information, as mentioned in the AI-generated summary.

  1. For verified owners:
    Old: "project.givback_toast.description.verified_owner_not_eligible": "No obstant això, donar a aquest projecte no generarà GIVbacks per als donants."
    New: "project.givback_toast.description.verified_owner_not_eligible": "El teu projecte ha estat avalat pels Verificadors de Giveth i ara pot beneficiar-se de GIVpower. {stakeLock} per obtenir GIVpower i millorar la posició d'aquest projecte a la pàgina de projectes. Nota: Aquest projecte pot ser impulsat, però no genera GIVbacks."

  2. For public projects:
    Old: "project.givback_toast.description.verified_public_not_eligible": "Nota: Aquest projecte pot ser impulsat, però no genera GIVbacks."
    New: "project.givback_toast.description.verified_public_not_eligible": "{stakeLock} per obtenir GIVpower i millorar la posició d'aquest projecte a la pàgina de projectes. Nota: Aquest projecte pot ser impulsat, però no genera GIVbacks."

These changes provide more detailed information about the GIVpower system and how it relates to project visibility.


Line range hint 1-1651: Summary of changes in lang/ca.json

After reviewing the changes in the Catalan language file, I can confirm that all modifications mentioned in the AI-generated summary have been accurately implemented. The updates include:

  1. Changed label for navigating to DeVouch
  2. Updated description for vouching for a project
  3. Modified title for vouching for a project
  4. Updated descriptions for verified owners and public projects not eligible for GIVbacks, including placeholders for staking information

These changes improve the clarity and informativeness of the messages related to the DeVouch and GIVbacks systems. No formatting issues or inconsistencies were found in the changed entries or the surrounding context.

Overall, these updates should enhance user understanding of these features in the Catalan version of the application.

lang/en.json Outdated
Comment on lines 1649 to 1651
"project.givback_toast.description.verified_owner_not_eligible": "Your project has been vouched for by Giveth Verifiers and can now benefit from GIVpower! {stakeLock} to get GIVpower and boost this project's position on the projects page! Note: This project can be boosted, but does not yield GIVbacks.",
"project.givback_toast.description.verified_public": "Ethereum donations to GIVbacks Eligible projects are rewarded with GIV. Boost this project to increase its rewards percentage and make it more visible on the projects page!",
"project.givback_toast.description.verified_public_not_eligible": "{stakeLock} your GIV tokens to get GIVpower. Boost this project make it more visible on the projects page! Note that while this project is eligible to be boosted with GIVpower, it will not yield GIVbacks to it's donors.",
"project.givback_toast.description.verified_public_not_eligible": "{stakeLock} to get GIVpower and boost this project's position on the projects page! Note: This project can be boosted, but does not yield GIVbacks.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Placeholder {stakeLock} is not being properly handled in the application code

  • The {stakeLock} placeholder is present in the translation files (lang/en.json, lang/es.json, lang/ca.json) for the keys:

    • project.givback_toast.description.verified_owner_not_eligible
    • project.givback_toast.description.verified_public_not_eligible
  • No instances were found in JavaScript or TypeScript files where these translation keys are used with the {stakeLock} substitution.

  • This may result in the placeholder {stakeLock} being displayed literally in the user interface instead of dynamic content.

🔗 Analysis chain

Improved clarity on project eligibility and boosting

The updates to these descriptions provide clearer information about project boosting and GIVbacks eligibility. The consistent messaging across owner and public views is good for maintaining clarity.

Ensure that the {stakeLock} placeholder is correctly handled in the code where these strings are used. Run the following script to check for proper usage:

This will help verify that the placeholder is being replaced with the appropriate content when the messages are displayed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for proper usage of the {stakeLock} placeholder
rg -t js -t ts "project\.givback_toast\.description\.(verified_owner_not_eligible|verified_public_not_eligible)" -A 5 -B 5

Length of output: 124


Script:

#!/bin/bash
# Search for usage of the specific translation keys across all relevant files
rg "project\.givback_toast\.description\.(verified_owner_not_eligible|verified_public_not_eligible)" --files-with-matches | while read -r file; do
  echo "File: $file"
  rg "{stakeLock}" "$file" -A 3 -B 3
done

Length of output: 711


Script:

#!/bin/bash
# Search for usage of the specific translation keys across all relevant files and correctly escape curly braces
rg "project\.givback_toast\.description\.(verified_owner_not_eligible|verified_public_not_eligible)" --files-with-matches | while read -r file; do
  echo "File: $file"
  rg "\{stakeLock\}" "$file" -A 3 -B 3
done

Length of output: 5417


Script:

#!/bin/bash
# Search for usage of the specific translation keys in JS and TS files and verify {stakeLock} substitution
keys=(
  "project.givback_toast.description.verified_owner_not_eligible"
  "project.givback_toast.description.verified_public_not_eligible"
)

for key in "${keys[@]}"; do
  echo "Searching for key: $key"
  rg "$key" --type js --type ts --multiline -A 5 -B 5 | while read -r line; do
    echo "$line"
    if echo "$line" | grep -q "{stakeLock}"; then
      echo "-> Placeholder {stakeLock} found in usage"
    else
      echo "-> No placeholder substitution detected"
    fi
  done
done

Length of output: 782

Copy link
Collaborator

@RamRamez RamRamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks @divine-comedian
Just two minor fixes.

lang/ca.json Outdated Show resolved Hide resolved
src/components/views/project/projectGIVPower/index.tsx Outdated Show resolved Hide resolved
@divine-comedian
Copy link
Contributor Author

Thanks @RamRamez ready for another review

@divine-comedian
Copy link
Contributor Author

FYI @MohammadPCh we should merge this BEFORE doing the release

Copy link
Collaborator

@RamRamez RamRamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@divine-comedian divine-comedian merged commit 00a3627 into develop Oct 1, 2024
3 checks passed
@divine-comedian divine-comedian deleted the deverification-fixes-laurensfeedback branch October 1, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: QA
Development

Successfully merging this pull request may close these issues.

2 participants